import { Outlet, Link, useLoaderData } from 'react-router';

export default function App() {
  const data = useLoaderData();
  return (
    <div>
      <h1>React Router Data Mode Demo</h1>
      <nav>
        <ul>
          <li>
            <Link to="/">Home</Link>
          </li>
          <li>
            <Link to="/contacts/1">Contact 1</Link>
          </li>
        </ul>
      </nav>
      <pre>{JSON.stringify(data, null, 2)}</pre>
      <Outlet />
    </div>
  );
}
